Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add delete_dirs function #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

zranguai
Copy link

@zranguai zranguai commented Nov 25, 2023

When I used this tool to convert, I made a mistake in the path and the code and other files under the path was deleted, so I think specified that the file to be deleted was a newly generated file.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

📊 Key Changes

  • Added a new delete_dirs function to utils.py.
  • Modified the make_dirs function to use the new delete_dirs instead of shutil.rmtree for directory deletion.

🎯 Purpose & Impact

  • The delete_dirs function is designed to selectively delete files with specific image extensions (like .jpg, .png, etc.) and .txt files within a directory.
  • This addition is safer, as it does not remove directories themselves but rather cleanses them of certain file types, reducing the risk of inadvertently deleting important data or directories.
  • It also could be seen as a more organized way of handling directory content management, focusing on specific file types related to image processing and machine learning tasks that Ultralytics software commonly deals with.

🌟 Summary

🗑️ "Introducing a targeted directory cleanup function to safely remove image and text files without erasing entire folders!"

@glenn-jocher
Copy link
Member

@zranguai hi there! Thank you for your suggestion. It sounds like you encountered an issue with file deletion during conversion. We take user feedback seriously for enhancing our tools' robustness. In the meantime, you may find the "--exist-ok" argument useful for skipping existing files during conversion. For any further assistance, you can refer to our documentation at https://docs.ultralytics.com. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants